<%@page language="java" contentType="text/html; character=UTF-8" pageEncoding="UTF-8" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <title>管理员后台</title>
    <link rel="stylesheet" href="<%=request.getContextPath() %>/resource/css/pintuer.css">
    <link rel="stylesheet" href="<%=request.getContextPath() %>/resource/css/admin.css">
    <script src="<%=request.getContextPath() %>/resource/js/jquery.js"></script>
    <script src="<%=request.getContextPath() %>/resource/js/pintuer.js"></script>
</head>
<body>
<div class="panel admin-panel">
    <div class="padding border-bottom">
        <ul class="search" style="padding-left: 10px;">
            <li>
                <a class="button border-main icon-plus-square-o" href="<%=request.getContextPath() %>/icc/addCategory">新增类目</a>
            </li>
        </ul>
    </div>
    <table class="table table-hover text-center">
        <tr>
            <th>ID</th>
            <th>类别名称</th>
            <th>操作</th>
        </tr>
        <%int i=1;%>
    <c:forEach items="${page}" var="data" varStatus="l">
        <tr>
            <td><%=(i++)%></td>
            <td>${data.name}</td>
            <td>
                <div class="button-group">
                    <a class="button border-main" href="<%=request.getContextPath() %>/icc/findBySql2?pid=${data.id}"><span class="icon-edit">查看商品信息</span> </a>
                    <a class="button border-main" href="<%=request.getContextPath() %>/icc/update?id=${data.id}"><span class="icon-edit">修改</span> </a>
                    <a class="button border-red" href="<%=request.getContextPath() %>/icc/delete?id=${data.id}"><span class="icon-trash-o">删除</span> </a>
                </div>
            </td>
        </tr>
    </c:forEach>
        <tr>
            <td colspan="8">
                <div class="pagelist">
                	<span>共有:${totalPage}页</span>
					<span>当前第:${current}页</span>
					<c:if test="${current gt 1}">
						<a href="<%=request.getContextPath() %>/icc/itemCategory?current=${current-1}">上一页</a>
					</c:if>
					<c:if test="${current lt totalPage}">
						<a href="<%=request.getContextPath() %>/icc/itemCategory?current=${current+1}">下一页</a>
					</c:if>
                </div>
            </td>
        </tr>
    </table>
</div>
</body>
</html>